<!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page language="java" contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 
%>

<html>
  <head>
	<link href="<%=path%>/jquery/upload/css/default.css" rel="stylesheet" type="text/css" />
	<link href="<%=path%>/jquery/upload/css/uploadify.css" rel="stylesheet" type="text/css" />
	<link href="<%=path%>/css/blog/function.css" rel="stylesheet" type="text/css"/>
	<link href="<%=path%>/jquery/ui/css/trontastic/jquery-ui-1.8.7.custom.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="<%=path%>/js/js1.js"></script>
	<script type="text/javascript" src="<%=path%>/jquery/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="<%=path%>/jquery/upload/js/swfobject.js"></script>
	<script type="text/javascript" src="<%=path%>/jquery/upload/js/jquery.uploadify.v2.1.0.min.js"></script>
	<script type="text/javascript" src="<%=path%>/jquery/ui/jquery-ui-1.8.7.custom.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#uploadify").uploadify({
				'uploader'       : '<%=path%>/jquery/upload/js/uploadify.swf',
				'cancelImg'      : '<%=path%>/jquery/upload/images/cancel2.png',
				'buttonImg'      : '<%=path%>/jquery/upload/images/add.png',
				'fileDataName'   : 'fileUpload', //和以下input的name属性一致 
				'displayData'    : 'percentage' , //'percentage' / 'speed' 
				'buttonText'     : '', 
				'queueID'        : 'fileQueue', //和存放队列的DIV的id一致 
				'auto'           : false,
				'multi'          : true,
				'width'          : 116,
				'height'         : 36,
				'sizeLimit'      : 1024000, //设置单个文件大小限制 
				'simUploadLimit' : 20 ,//一次同步上传的文件数目
				'queueSizeLimit' : 20, //队列中同时存在的文件个数限制 
				'fileExt'        : '*.png;*.gif;*.jpg;*.bmp;*.jpeg;*.tmp', //允许的格式   
                'fileDesc'       : '图片文件(*.png;*.gif;*.jpg;*.bmp;*.jpeg;*.tmp)' //如果配置了以下的'fileExt'属性，那么这个属性是必须的
			});
		});
	</script>
	<script type="text/javascript"> 
        //必须的 
		function uploadifyUpload(){
		  	$('#uploadify').uploadifySettings('script','<%=basePath %>picture/insert.do?sitesAlbum.id='+$("select option:selected").val());
		   	$('#uploadify').uploadifyUpload(); 
		} 
	</script> 
</head>

<body>
<table>
<tr> 
<td>上传图片：</td> 
<td> 
<form action="<%=path %>/picture/insert.do" method="post" enctype="multipart/form-data">
<a href="<%=request.getHeader("Referer")%>">返回</a> 择相册：<select id="select" name="album">
<option value="0" selected>ME</option>
<option value="0" selected>ME</option>
<option value="0" selected>ME</option>
<option value="0" selected>ME</option>
<option value="0" selected>ME</option>
</select>
<input type="file" name="fileUpload" id="uploadify" />
<div id="fileQueue"></div>
<p> 
<a href="javascript:;" onclick="javascript:uploadifyUpload()">开始上传</a>
<a href="javascript:jQuery('#uploadify').uploadifyClearQueue()">撤销上传</a>
</p>
</form>
</td> 
</tr> 
</table>
</body>
</html>
